import Vue from "vue";
import VueRouter from "vue-router";
const originalPush = VueRouter.prototype.push;

VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
};
Vue.use(VueRouter);
// 考官-在线阅卷 /home/default
// 比赛 /videoResult

const routes = [
  {
    path: "/",
    redirect: "/videoResult"
  },
  {
    path: "/login",
    name: "Login",
    meta: {
      keepAlive: false
    },
    component: () => import("@/views/login"),
  },
  {
    path: "/videoResult",
    name: "videoResult",
    meta: {
      keepAlive: false
    },
    component: () => import("@/views/videoResult"),
  }
];

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes,
});

export default router;
